MessageBox
ActionResult = MessageBox(Title$, Text$, Flags)
 
Parameters:

    Title$ = The TITLE this message dislog should use
    Text$ = The message to be shown to the user
    Flags = Flags to select the type of message box to display
Returns:

    ActionResult = The action that the user selected
 

     MessageBox pops a windows message box dialog. Message Boxes can accept various responses from the user, but they're generally used to ask a question that requires a YES or NO response.



Message Box Flags constants


     These constants are declared in the dialogs library, used them in the FLAGS input field.



MB_ABORTRETRYIGNORE = The message Box contains three Push buttons: Abort, Retry, And Ignore.

MB_OK =The message Box contains one Push button: OK. This is the default.

MB_OKCANCEL = The message Box contains two Push buttons: OK And Cancel.

MB_RETRYCANCEL = The message Box contains two Push buttons: Retry And Cancel.

MB_YESNO = The message Box contains two Push buttons: Yes And No.

MB_YESNOCANCEL = The message Box contains three Push buttons: Yes, No, And Cancel.

MB_ICONWARNING = An exclamation-Point icon appears in the message box.

MB_ICONINFORMATION = An icon consisting of a lowercase letter i in a Circle appears in the message box.
MB_ICONQUESTION = A question-mark icon appears in the message box.

MB_ICONSTOP = A stop-sign icon appears in the message box.

MB_DEFBUTTON1 = The first button is the Default button. MB_DEFBUTTON1 is the Default unless MB_DEFBUTTON2, MB_DEFBUTTON3, Or MB_DEFBUTTON4 is specified.

MB_DEFBUTTON2= The second button is the Default button.

MB_DEFBUTTON3 = The third button is the Default button.

MB_DEFBUTTON4= The fourth button is the Default button.





Message Box Action Result values



IDABORT = Abort button was selected.
IDCANCEL = Cancel button was selected.
IDIGNORE = Ignore button was selected.
IDNO = No button was selected.
IDOK = OK button was selected.
IDRETRY = Retry button was selected.
IDYES = Yes button was selected.





FACTS:


      * MessageBox is not asynchronous, so the PlayBasic application will halt while the dialog is open.


 
Example Source: Download This Example
; Include the Dialogs library in this program
  #Include "PBDialogs"
  
; Clear the Screen to Blue
  Cls RGB(0,0,255)
  
; Init the Message Box dialogs TItle and messages
  Title$="Play Dialog Message Box"
  Text$="Important Question: Is Today A Wednesday ?"
  
  
; Call the Message Box Function.  This box will
; have a YES & NO option for the users
  UserAction=MessageBox(Title$,Text$,MB_YESNO)
  
  
; display a message depending upon what the user pressed
  Select UserAction
      Case IDNO
          Print "You Pressed NO"
      Case IDYES
          Print "You Pressed Yes"
  EndSelect
  
  
  Sync
  WaitKey
  
  
  
  
 
Related Info: ShowMessage :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com